home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_06
/
1006026a
< prev
next >
Wrap
Text File
|
1992-04-12
|
893b
|
39 lines
// TESTLOCK.C
//
//
// TESTLOCK is calls FAKELOCK to learn the return values it
// will create. By writing down the input string and the return
// value they can be added to your program like they are in TESTPROG.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "fakelock.h"
void main( void )
{
char instr[96]; // input string
char *mesg = "\rEnter string to test FAKELOCK (empty string to end): ";
int key; // which lock to use
int results; // return value from FAKELOCK
char temp[96]; // tempory place to get which lock
printf( mesg );
gets( instr );
while ( strlen( instr ) > 0 )
{
printf("Which lock (1 or 2): ");
gets( temp );
key = atoi( temp );
results = FAKELOCK( instr, key );
printf("FAKELOCK results : %d\n", results );
printf( mesg );
gets( instr );
}
}